Skip to content

Improve error message for geom_density() when using y #3519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

yutannihilation
Copy link
Member

Close #3514.

This PR make StatDensity raise a consistent error with other stats like StatCount.

devtools::load_all("~/Documents/repo/ggplot2/")
#> Loading ggplot2

library(ggplot2)

d <- base::data.frame(x = 1:3)

ggplot(d) +
  geom_density(aes(x, x))
#> Error: stat_density() must not be used with a y aesthetic.

@yutannihilation yutannihilation changed the title Improve a error for geom_density() when using y Improve error message for geom_density() when using y Sep 6, 2019
@thomasp85
Copy link
Member

I'm going to close as #3506 makes it obsolete

@lock
Copy link

lock bot commented Mar 27, 2020

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Mar 27, 2020
@yutannihilation yutannihilation deleted the fix/issue-3514-geom-density-error branch March 27, 2022 04:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix error message for geom_density() when using y
2 participants